//============================================================================================
/**
 * @file	pst_obj.c
 * @brief	ポケモンステータス画面OBJ
 * @author	Hiroyuki Nakamura
 * @date	2005.10.27
 */
//============================================================================================
#include "common.h"
#include "system/procsys.h"
#include "system/arc_tool.h"
#include "system/arc_util.h"
#include "system/clact_tool.h"
#include "system/window.h"
#include "system/msgdata.h"
#include "system/numfont.h"
#include "system/wordset.h"
#include "system/bmp_menu.h"
#include "system/buflen.h"
#include "battle/battle_common.h"
#include "poketool/monsno.h"
#include "poketool/pokeicon.h"
#include "poketool/pokeparty.h"
#include "poketool/waza_tool.h"
#include "application/app_tool.h"
#include "battle/wazatype_icon.h"
#include "ribbon.h"
#include "data/clact_util/clact_header.naix"

#define	PST_OBJ_H_GLOBAL
#include "application/p_status.h"
#include "pst_sys.h"
#include "pst_obj.h"
#include "pst_sub.h"
#include "pst_snd_def.h"
#include "application/pst_gra.naix"
#include "application/pst2_gra.naix"
#include "pst_bmp_def.h"

//============================================================================================
//	定数定義
//============================================================================================
// セルアクターのリソースID
enum {
	PST_CHR_ID_BALL = 0,		// モンスターボール
	PST_CHR_ID_TAB,				// ページタブ
	PST_CHR_ID_WAZACURSOR,		// 技選択カーソル

	PST_CHR_ID_POKETYPE1,		// ポケモンのタイプアイコン１
	PST_CHR_ID_POKETYPE2,		// ポケモンのタイプアイコン２
	PST_CHR_ID_WAZATYPE1,		// 技タイプアイコン１
	PST_CHR_ID_WAZATYPE2,		// 技タイプアイコン２
	PST_CHR_ID_WAZATYPE3,		// 技タイプアイコン３
	PST_CHR_ID_WAZATYPE4,		// 技タイプアイコン４
	PST_CHR_ID_WAZATYPE5,		// 技タイプアイコン５
	PST_CHR_ID_WAZAKIND,		// 技分類アイコン			10

	PST_CHR_ID_POKEICON,		// ポケモンアイコン

	PST_CHR_ID_STIZYO,			// 状態異常アイコン
	PST_CHR_ID_FLASH,			// けづや
	PST_CHR_ID_ARROW,			// ページ切り替え矢印

	PST_CHR_ID_CNDITION_UP,		// コンディション上昇矢印

	PST_CHR_ID_A_BUTTON,		// Aボタンマーク

	PST_CHR_ID_MARK01,			// ボックスマーク１
	PST_CHR_ID_MARK02,			// ボックスマーク２
	PST_CHR_ID_MARK03,			// ボックスマーク３
	PST_CHR_ID_MARK04,			// ボックスマーク４			20
	PST_CHR_ID_MARK05,			// ボックスマーク５
	PST_CHR_ID_MARK06,			// ボックスマーク６
	PST_CHR_ID_MARK07,			// ポケルス・レアカラー

	PST_CHR_ID_EZCND,			// 簡易コンディションマーク

	PST_CHR_ID_RIBBON01,		// リボン１
	PST_CHR_ID_RIBBON02,		// リボン２
	PST_CHR_ID_RIBBON03,		// リボン３
	PST_CHR_ID_RIBBON04,		// リボン４
	PST_CHR_ID_RIBBON05,		// リボン５
	PST_CHR_ID_RIBBON06,		// リボン６					30
	PST_CHR_ID_RIBBON07,		// リボン７
	PST_CHR_ID_RIBBON08,		// リボン８
	PST_CHR_ID_RIBBON09,		// リボン９
	PST_CHR_ID_RIBBON_CUR,		// リボンカーソル

	PST_CHR_ID_RIBBON_FLASH,	// リボンの光
	PST_CHR_ID_CON_FLASH,		// コンディションの光
	PST_CHR_ID_POKERUS,			// ポケルス用状態異常アイコン

	PST_CHR_ID_POKEICON01,		// 選択用ポケモンアイコン１
	PST_CHR_ID_POKEICON02,		// 選択用ポケモンアイコン２
	PST_CHR_ID_POKEICON03,		// 選択用ポケモンアイコン３ 40
	PST_CHR_ID_POKEICON04,		// 選択用ポケモンアイコン４
	PST_CHR_ID_POKEICON05,		// 選択用ポケモンアイコン５
	PST_CHR_ID_POKEICON06,		// 選択用ポケモンアイコン６

	PST_CHR_ID_P_STAR,			// パフォーマンス値用「☆」44
};

#define	PT_ICON_P1_PX	( A_OBJ_P1_TYPE_PX*8+12/*199*/ )		// ポケモン情報ページのポケモンタイプアイコン表示X座標
#define	PT_ICON_P1_PY	( A_OBJ_P1_TYPE_PY*8+8/*80*/ )		// ポケモン情報ページのポケモンタイプアイコン表示Y座標
#define	PT_ICON_P4_PX	( 25*8/*63*/ )		// 戦う技ページのポケモンタイプアイコン表示X座標
#define	PT_ICON_P4_PY	( 3*8/*52*/ )		// 戦う技ページのポケモンタイプアイコン表示Y座標
#define	WT_ICON_P4_PX	( 3*8/*151*/ )		// 戦う技ページの技タイプアイコン表示X座標
#define	WT_ICON_P4_PY	( 2*8/*43*/ )		// 戦う技ページの技タイプアイコン表示Y座標
#define	KT_ICON_P4_PX	( 29*8/*92+16*/ )	// 戦う技ページの分類アイコン表示X座標
#define	KT_ICON_P4_PY	( 5*8/*72*/ )		// 戦う技ページの分類アイコン表示Y座標
#define	POKE_ICON_PX		( 20*8/*24*/ )	// 戦う技ページのポケモンアイコン表示X座標
#define	POKE_ICON_PY		( 2*8/*48*/ )	// 戦う技ページのポケモンアイコン表示Y座標
#define	CON_POKE_ICON_PX	( 32 )	// コンテスト技ページのポケモンアイコン表示X座標
#define	CON_POKE_ICON_PY	( 68 )	// コンテスト技ページのポケモンアイコン表示Y座標

#define	TAB_PX	( 128 )		// ページタブ表示X座標
#define	TAB_PY	( 24 )		// ページタブ表示Y座標

#define	BALL_PX	( 21*8  /*16*/ )		// ボール表示X座標
#define	BALL_PY	( 5*8-1 /*32*/ )		// ボール表示Y座標

#define	WAZACURSOR_PX	( 8*8+4/*194*/ )	// 技カーソル表示X座標
#define	WAZACURSOR_PY	( 3*8 /*48*/ )		// 技カーソル表示Y座標

#define	RET_CURSOR_PX	( 27*8+4 )	// 戻るカーソル表示X座標
#define	RET_CURSOR_PY	( 22*8 )	// 戻るカーソル表示Y座標

#define	ST_ICON_PX	( 232 )			// 状態異常アイコン表示X座標
#define	ST_ICON_PY	( 58 )			// 状態異常アイコン表示Y座標

#define	ST_ICON_POKERUS_PX	( 228 )	// ポケルスアイコン表示X座標
#define	ST_ICON_POKERUS_PY	( 54 )	// ポケルスアイコン表示Y座標

#define	TAB_ARROW_PY	( 24 )		// ページタブ切り替え矢印表示Y座標

#define	BOX_MARK_PX	( /*48*/25*8 )			// ボックスマーク表示X座標
#define	BOX_MARK_PY	( 150 )			// ボックスマーク表示Y座標

#define	FLASH_PX	( 152 )			// けづや表示X座標
#define	FLASH_PY	( 168 )			// けづや表示Y座標

#define	RARE_MARK_PX		( 252 )		// レアマーク表示X座標
#define	RARE_MARK_PY		( 72 )		// レアマーク表示Y座標
#define	POKERUS_MARK_PX		( 252 )		// ポケルスマーク表示X座標
#define	POKERUS_MARK_PY		( 132 )		// ポケルスマーク表示Y座標

#define	RIBBON_MX	( 32 )				// リボン表示X間隔
#define	RIBBON_MY	( 40 )				// リボン表示Y間隔

#define	RIBON_PX1	( 4*8/*132*/ )						// リボン表示X座標（１列目）
#define	RIBON_PX2	( RIBON_PX1 + RIBBON_MX )	// リボン表示X座標（２列目）
#define	RIBON_PX3	( RIBON_PX2 + RIBBON_MX )	// リボン表示X座標（３列目）

#define	RIBON_PY1	( 3*8/*56*/ )						// リボン表示Y座標（１行目）
#define	RIBON_PY2	( RIBON_PY1 + RIBBON_MY )	// リボン表示Y座標（２行目）
#define	RIBON_PY3	( RIBON_PY2 + RIBBON_MY )	// リボン表示Y座標（３行目）

#define	RIBBON_ARROW_PX		( 128 )				// リボン切り替え矢印表示X座標
#define	RIBBON_ARROW_UPY	( 32 )				// リボン切り替え上矢印表示Y座標
#define	RIBBON_ARROW_DPY	( 96 )				// リボン切り替え下矢印表示Y座標

#define	TAB_CENTER_PX	( 23 * 8 + 4 )	// タブ表示中心X座標
#define	TAB_SEL_SX		( 24 )			// 選択中のタブXサイズ
#define	TAB_NOSEL_SX	( 16 )			// その他のタブXサイズ
#define	TAB_L_ARROW_PSX	( -12 )			// タブ切り替え左矢印の表示X座標補正値
#define	TAB_R_ARROW_PSX	( -4 )			// タブ切り替え右矢印の表示X座標補正値

#define	KEDUYA_ANM_MAX	( 12 )		// けづや表示最大数

#define	A_BUTTON_PY		( 8 )	///< Aボタンマーク表示Y座標

#define	PST_POKEICON_PAL	( 12 )	// ポケモンアイコンで使用するパレット番号
#define	PST_RIBBON_PAL		( 7 )	// リボンで使用するパレット番号
#define PST_TYPEICON_PAL	( 3 )	// タイプアイコンのパレット


#define POKEICON1_PX	( 184 )
#define POKEICON1_PY	(  50 )
#define POKEICON2_PX	( 224 )
#define POKEICON2_PY	(  58 )
#define POKEICON3_PX	( 184 )
#define POKEICON3_PY	(  82 )
#define POKEICON4_PX	( 224 )
#define POKEICON4_PY	(  90 )
#define POKEICON5_PX	( 184 )
#define POKEICON5_PY	( 114 )
#define POKEICON6_PX	( 224 )
#define POKEICON6_PY	( 122 )

#define PERFORMANCE_00_01_X	(  8*8 )
#define PERFORMANCE_00_01_Y	(  6*8 )
#define PERFORMANCE_00_02_X	( 10*8 )
#define PERFORMANCE_00_02_Y	(  6*8 )
#define PERFORMANCE_00_03_X	( 12*8 )
#define PERFORMANCE_00_03_Y	(  6*8 )
#define PERFORMANCE_00_04_X	( 14*8 )
#define PERFORMANCE_00_04_Y	(  6*8 )
#define PERFORMANCE_00_05_X	( 16*8 )
#define PERFORMANCE_00_05_Y	(  6*8 )

#define PERFORMANCE_01_01_X	(  8*8 )
#define PERFORMANCE_01_01_Y	( 10*8 )
#define PERFORMANCE_01_02_X	( 10*8 )
#define PERFORMANCE_01_02_Y	( 10*8 )
#define PERFORMANCE_01_03_X	( 12*8 )
#define PERFORMANCE_01_03_Y	( 10*8 )
#define PERFORMANCE_01_04_X	( 14*8 )
#define PERFORMANCE_01_04_Y	( 10*8 )
#define PERFORMANCE_01_05_X	( 16*8 )
#define PERFORMANCE_01_05_Y	( 10*8 )

#define PERFORMANCE_02_01_X	(  8*8 )
#define PERFORMANCE_02_01_Y	( 14*8 )
#define PERFORMANCE_02_02_X	( 10*8 )
#define PERFORMANCE_02_02_Y	( 14*8 )
#define PERFORMANCE_02_03_X	( 12*8 )
#define PERFORMANCE_02_03_Y	( 14*8 )
#define PERFORMANCE_02_04_X	( 14*8 )
#define PERFORMANCE_02_04_Y	( 14*8 )
#define PERFORMANCE_02_05_X	( 16*8 )
#define PERFORMANCE_02_05_Y	( 14*8 )

#define PERFORMANCE_03_01_X	(  8*8 )
#define PERFORMANCE_03_01_Y	( 18*8 )
#define PERFORMANCE_03_02_X	( 10*8 )
#define PERFORMANCE_03_02_Y	( 18*8 )
#define PERFORMANCE_03_03_X	( 12*8 )
#define PERFORMANCE_03_03_Y	( 18*8 )
#define PERFORMANCE_03_04_X	( 14*8 )
#define PERFORMANCE_03_04_Y	( 18*8 )
#define PERFORMANCE_03_05_X	( 16*8 )
#define PERFORMANCE_03_05_Y	( 18*8 )

#define PERFORMANCE_04_01_X	(  8*8 )
#define PERFORMANCE_04_01_Y	( 22*8 )
#define PERFORMANCE_04_02_X	( 10*8 )
#define PERFORMANCE_04_02_Y	( 22*8 )
#define PERFORMANCE_04_03_X	( 12*8 )
#define PERFORMANCE_04_03_Y	( 22*8 )
#define PERFORMANCE_04_04_X	( 14*8 )
#define PERFORMANCE_04_04_Y	( 22*8 )
#define PERFORMANCE_04_05_X	( 16*8 )
#define PERFORMANCE_04_05_Y	( 22*8 )

#define PERFORMANCE_ARROW0_X	( 10*8 )
#define PERFORMANCE_ARROW0_Y	(  4*8 )
#define PERFORMANCE_ARROW1_X	( 10*8 )
#define PERFORMANCE_ARROW1_Y	(  8*8 )
#define PERFORMANCE_ARROW2_X	( 10*8 )
#define PERFORMANCE_ARROW2_Y	( 12*8 )
#define PERFORMANCE_ARROW3_X	( 10*8 )
#define PERFORMANCE_ARROW3_Y	( 16*8 )
#define PERFORMANCE_ARROW4_X	( 10*8 )
#define PERFORMANCE_ARROW4_Y	( 20*8 )

#define POKEMON_LEAF0_X			(  91 )
#define POKEMON_LEAF1_X			( 101 )
#define POKEMON_LEAF2_X			( 111 )
#define POKEMON_LEAF3_X			( 121 )
#define POKEMON_LEAF4_X			( 131 )
#define POKEMON_LEAF5_X			( 111 )
#define POKEMON_LEAF0_Y			( 182 )

// パフォーマンス用☆の数と状態変化を表す矢印アイコンの数
#define PERFORMANCE_OBJ_NUM		( 25 )
#define PERFORMANCE_ARROW_NUM	(  5 )


//============================================================================================
//============================================================================================
static void AddCellActMake( PST_WORK * wk );
static void PokeStatus_TypeIconChange( PST_WORK * wk, u8 act_num, u8 res_id, u8 type );
static void InitObjCharPalChg( PST_WORK * wk );
static void performance_icon_hide( PST_WORK *wk );
static void DrawPerformanceIcon( CLACT_WORK_PTR *act, int start, int max, int num, int revision, int affect, int arrow );
static void poke_leaf_icon_hide( PST_WORK *wk );


//============================================================================================
//============================================================================================
static const TCATS_OBJECT_ADD_PARAM	ActAddParam[] =
{
	///< リソース内データの登録番号 , [ X ] 座標	, [ Y ] 座標, [ Z ] 座標
	///< アニメ番号, 優先順位,  パレット番号, 描画エリア
	///< 転送用フラグ(TCATS_PALMODE_MAN,TCATS_PALMODE_AUTO)

	{	// ページタブ１
		PST_CHR_ID_TAB, TAB_PX, TAB_PY, 0,
		0, 1, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ページタブ２
		PST_CHR_ID_TAB, TAB_PX+16, TAB_PY, 0,
		1, 1, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ページタブ３
		PST_CHR_ID_TAB, TAB_PX+32, TAB_PY, 0,
		2, 1, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ページタブ４
		PST_CHR_ID_TAB, TAB_PX+48, TAB_PY, 0,
		3, 1, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ページタブ５
		PST_CHR_ID_TAB, TAB_PX+64, TAB_PY, 0,
		4, 1, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ページタブ６
		PST_CHR_ID_TAB, TAB_PX+80, TAB_PY, 0,
		5, 1, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ページタブ７
		PST_CHR_ID_TAB, TAB_PX+96, TAB_PY, 0,
		6, 1, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ページタブ８
		PST_CHR_ID_TAB, TAB_PX+112, TAB_PY, 0,
		7, 1, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// モンスターボール
		PST_CHR_ID_BALL, BALL_PX, BALL_PY, 0,
		0, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// 技選択カーソル１
		PST_CHR_ID_WAZACURSOR, WAZACURSOR_PX, WAZACURSOR_PY, 0,
		0, 1, 2, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},

	{	// 技選択カーソル２				10
		PST_CHR_ID_WAZACURSOR, WAZACURSOR_PX, WAZACURSOR_PY, 0,
		1, 0, 2, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// ポケモンタイプ１
		PST_CHR_ID_POKETYPE1, 0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// ポケモンタイプ２
		PST_CHR_ID_POKETYPE2, 0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// 技タイプ１
		PST_CHR_ID_WAZATYPE1, 0, 0, 0,
		0, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// 技タイプ２
		PST_CHR_ID_WAZATYPE2, 0, 0, 0,
		0, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// 技タイプ３
		PST_CHR_ID_WAZATYPE3, 0, 0, 0,
		0, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// 技タイプ４
		PST_CHR_ID_WAZATYPE4, 0, 0, 0,
		0, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// 技タイプ５
		PST_CHR_ID_WAZATYPE5, 0, 0, 0,
		0, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// 技分類
		PST_CHR_ID_WAZAKIND, 0, 0, 0,
		0, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},

	{	// ポケモンアイコン
		PST_CHR_ID_POKEICON, POKE_ICON_PX, POKE_ICON_PY, 0,
		0, 0, 4, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},


	{	// 状態異常アイコン				20
		PST_CHR_ID_STIZYO, ST_ICON_PX, ST_ICON_PY, 0,
		0, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// タブ切り替え矢印・左
		PST_CHR_ID_ARROW, 0, TAB_ARROW_PY, 0,
		0, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// タブ切り替え矢印・右
		PST_CHR_ID_ARROW, 0, TAB_ARROW_PY, 0,
		1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ボックスマーク１
		PST_CHR_ID_MARK01, BOX_MARK_PX, BOX_MARK_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ボックスマーク２
		PST_CHR_ID_MARK02, BOX_MARK_PX+8, BOX_MARK_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ボックスマーク３
		PST_CHR_ID_MARK03, BOX_MARK_PX+16, BOX_MARK_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ボックスマーク４
		PST_CHR_ID_MARK04, BOX_MARK_PX+24, BOX_MARK_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ボックスマーク５
		PST_CHR_ID_MARK05, BOX_MARK_PX+32, BOX_MARK_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ボックスマーク６
		PST_CHR_ID_MARK06, BOX_MARK_PX+40, BOX_MARK_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや１
		PST_CHR_ID_FLASH, FLASH_PX, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや２					30
		PST_CHR_ID_FLASH, FLASH_PX+8, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや３
		PST_CHR_ID_FLASH, FLASH_PX+16, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや４
		PST_CHR_ID_FLASH, FLASH_PX+24, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや５
		PST_CHR_ID_FLASH, FLASH_PX+32, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや６
		PST_CHR_ID_FLASH, FLASH_PX+40, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや７
		PST_CHR_ID_FLASH, FLASH_PX+48, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや８
		PST_CHR_ID_FLASH, FLASH_PX+56, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや９
		PST_CHR_ID_FLASH, FLASH_PX+64, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや１０
		PST_CHR_ID_FLASH, FLASH_PX+72, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや１１
		PST_CHR_ID_FLASH, FLASH_PX+80, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// けづや１２				40
		PST_CHR_ID_FLASH, FLASH_PX+88, FLASH_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 「UP」１
		PST_CHR_ID_CNDITION_UP, 26*8, 6*8, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 「UP」２
		PST_CHR_ID_CNDITION_UP, 28*8, 11*8, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 「UP」３
		PST_CHR_ID_CNDITION_UP, 27*8, 15*8, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 「UP」４
		PST_CHR_ID_CNDITION_UP, 18*8, 15*8, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 「UP」５
		PST_CHR_ID_CNDITION_UP, 17*8, 11*8, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// Aボタンマーク
		PST_CHR_ID_A_BUTTON, 0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 簡易コンディション（かっこよさ）
		PST_CHR_ID_EZCND, 0, 0, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 簡易コンディション（うつくしさ）
		PST_CHR_ID_EZCND, 0, 0, 0,
		1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 簡易コンディション（かわいさ）
		PST_CHR_ID_EZCND, 0, 0, 0,
		3, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 簡易コンディション（かしこさ）	50
		PST_CHR_ID_EZCND, 0, 0, 0,
		2, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 簡易コンディション（たくましさ）
		PST_CHR_ID_EZCND, 0, 0, 0,
		4, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// レアカラーマーク
		PST_CHR_ID_MARK07, RARE_MARK_PX, RARE_MARK_PY, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ポケルスマーク
		PST_CHR_ID_MARK07, POKERUS_MARK_PX, POKERUS_MARK_PY, 0,
		1, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// リボン１
		PST_CHR_ID_RIBBON01, RIBON_PX1, RIBON_PY1, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン２
		PST_CHR_ID_RIBBON02, RIBON_PX2, RIBON_PY1, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン３
		PST_CHR_ID_RIBBON03, RIBON_PX3, RIBON_PY1, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン４
		PST_CHR_ID_RIBBON04, RIBON_PX1, RIBON_PY2, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン５
		PST_CHR_ID_RIBBON05, RIBON_PX2, RIBON_PY2, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン６
		PST_CHR_ID_RIBBON06, RIBON_PX3, RIBON_PY2, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン７
		PST_CHR_ID_RIBBON07, RIBON_PX1, RIBON_PY3, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン８
		PST_CHR_ID_RIBBON08, RIBON_PX2, RIBON_PY3, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン９
		PST_CHR_ID_RIBBON09, RIBON_PX3, RIBON_PY3, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボンカーソル
		PST_CHR_ID_RIBBON_CUR, RIBON_PX1, RIBON_PY1, 0,
		0, 0, 15, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボンスクロール矢印・上
		PST_CHR_ID_RIBBON_CUR, RIBBON_ARROW_PX, RIBBON_ARROW_UPY, 0,
		4, 0, 15, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボンスクロール矢印・下
		PST_CHR_ID_RIBBON_CUR, RIBBON_ARROW_PX, RIBBON_ARROW_DPY, 0,
		5, 0, 15, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// リボン光
		PST_CHR_ID_RIBBON_FLASH, 164, 148, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// コンディション光１
		PST_CHR_ID_CON_FLASH, RIBON_PX1, RIBON_PY1, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// コンディション光２
		PST_CHR_ID_CON_FLASH, RIBON_PX1, RIBON_PY1, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// コンディション光３
		PST_CHR_ID_CON_FLASH, RIBON_PX1, RIBON_PY1, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// コンディション光４
		PST_CHR_ID_CON_FLASH, RIBON_PX1, RIBON_PY1, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// コンディション光５
		PST_CHR_ID_CON_FLASH, RIBON_PX1, RIBON_PY1, 0,
		0, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// ポケルス用状態異常アイコン
		PST_CHR_ID_POKERUS, ST_ICON_POKERUS_PX, ST_ICON_POKERUS_PY, 0,
		0, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// ポケモンアイコン１
		PST_CHR_ID_POKEICON01, POKEICON1_PX, POKEICON1_PY, 0,
		0, 0, 4, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// ポケモンアイコン２
		PST_CHR_ID_POKEICON02, POKEICON2_PX, POKEICON2_PY, 0,
		0, 0, 4, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// ポケモンアイコン３
		PST_CHR_ID_POKEICON03, POKEICON3_PX, POKEICON3_PY, 0,
		0, 0, 4, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// ポケモンアイコン４
		PST_CHR_ID_POKEICON04, POKEICON4_PX, POKEICON4_PY, 0,
		0, 0, 4, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// ポケモンアイコン５
		PST_CHR_ID_POKEICON05, POKEICON5_PX, POKEICON5_PY, 0,
		0, 0, 4, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},
	{	// ポケモンアイコン６
		PST_CHR_ID_POKEICON06, POKEICON6_PX, POKEICON6_PY, 0,
		0, 0, 4, NNS_G2D_VRAM_TYPE_2DSUB, 0, 0, 0, 0
	},

	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_00_01_X, PERFORMANCE_00_01_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_00_02_X, PERFORMANCE_00_02_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_00_03_X, PERFORMANCE_00_03_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_00_04_X, PERFORMANCE_00_04_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_00_05_X, PERFORMANCE_00_05_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_01_01_X, PERFORMANCE_01_01_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_01_02_X, PERFORMANCE_01_02_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_01_03_X, PERFORMANCE_01_03_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_01_04_X, PERFORMANCE_01_04_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_01_05_X, PERFORMANCE_01_05_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_02_01_X, PERFORMANCE_02_01_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_02_02_X, PERFORMANCE_02_02_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_02_03_X, PERFORMANCE_02_03_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_02_04_X, PERFORMANCE_02_04_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_02_05_X, PERFORMANCE_02_05_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_03_01_X, PERFORMANCE_03_01_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_03_02_X, PERFORMANCE_03_02_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_03_03_X, PERFORMANCE_03_03_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_03_04_X, PERFORMANCE_03_04_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_03_05_X, PERFORMANCE_03_05_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_04_01_X, PERFORMANCE_04_01_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_04_02_X, PERFORMANCE_04_02_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_04_03_X, PERFORMANCE_04_03_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_04_04_X, PERFORMANCE_04_04_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値用「☆」
		PST_CHR_ID_P_STAR, PERFORMANCE_04_05_X, PERFORMANCE_04_05_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// パフォーマンス値　上昇・下降矢印
		PST_CHR_ID_P_STAR, PERFORMANCE_ARROW0_X, PERFORMANCE_ARROW0_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値　上昇・下降矢印
		PST_CHR_ID_P_STAR, PERFORMANCE_ARROW1_X, PERFORMANCE_ARROW1_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値　上昇・下降矢印
		PST_CHR_ID_P_STAR, PERFORMANCE_ARROW2_X, PERFORMANCE_ARROW2_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値　上昇・下降矢印
		PST_CHR_ID_P_STAR, PERFORMANCE_ARROW3_X, PERFORMANCE_ARROW3_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// パフォーマンス値　上昇・下降矢印
		PST_CHR_ID_P_STAR, PERFORMANCE_ARROW4_X, PERFORMANCE_ARROW4_Y, 0,
		0, 0, 5, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

	{	// 連れ歩きポケモンリーフ１
		PST_CHR_ID_P_STAR, POKEMON_LEAF0_X, POKEMON_LEAF0_Y, 0,
		6, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 連れ歩きポケモンリーフ２
		PST_CHR_ID_P_STAR, POKEMON_LEAF1_X, POKEMON_LEAF0_Y, 0,
		6, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 連れ歩きポケモンリーフ３
		PST_CHR_ID_P_STAR, POKEMON_LEAF2_X, POKEMON_LEAF0_Y, 0,
		6, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 連れ歩きポケモンリーフ４
		PST_CHR_ID_P_STAR, POKEMON_LEAF3_X, POKEMON_LEAF0_Y, 0,
		6, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 連れ歩きポケモンリーフ５
		PST_CHR_ID_P_STAR, POKEMON_LEAF4_X, POKEMON_LEAF0_Y, 0,
		6, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},
	{	// 連れ歩きポケモン王冠リーフ
		PST_CHR_ID_P_STAR, POKEMON_LEAF5_X, POKEMON_LEAF0_Y, 0,
		7, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 0, 0, 0
	},

};

// モンスターボールパレット（配列０はダミー）
static const u8 BallPalTbl[] = { 2,0,2,2,0,1,1,1,1,2,2,2,2,3,3,2,0,4,5,6,7,8,9,10,11 };



//---------------------------------------------------------------------------------------------
/**
 * セルアクター初期化
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatusCellActInit( PST_WORK * wk )
{
	GF_Disp_GX_VisibleControl( GX_PLANEMASK_OBJ, VISIBLE_ON );		// MAIN DISP OBJ ON
	GF_Disp_GXS_VisibleControl( GX_PLANEMASK_OBJ, VISIBLE_ON );		// SUB DISP OBJ ON

	initVramTransferManagerHeap( 32, HEAPID_POKESTATUS );

	wk->csp = CATS_AllocMemory( HEAPID_POKESTATUS );
	wk->crp = CATS_ResourceCreate( wk->csp );

	{
		TCATS_OAM_INIT	coi = {
			0, 128,
			0, 32,
			0, 128,
			0, 32,
		};
		TCATS_CHAR_MANAGER_MAKE ccmm = {
			PST_OBJ_MAX,
			1024,
			1024,
			GX_OBJVRAMMODE_CHAR_1D_32K,
			GX_OBJVRAMMODE_CHAR_1D_32K
		};
		CATS_SystemInit( wk->csp, &coi, &ccmm, 32 );
		CATS_ClactSetInit( wk->csp, wk->crp, PST_OBJ_MAX );
	}

	{
		///TCATS_RES_ARC
		TCATS_RESOURCE_FILE_LIST list = {
			NARC_clact_header_pst_chr_resdat,		// キャラクタ
			NARC_clact_header_pst_pal_resdat,		// パレット
			NARC_clact_header_pst_cell_resdat,		// セル
			NARC_clact_header_pst_canm_resdat,		// セルアニメ
			TCATS_RESID_NULL,						// マルチセル
			TCATS_RESID_NULL,						// マルチセルアニメ
			NARC_clact_header_pst_h_cldat			// ヘッダー
		};
		CATS_ResourceLoadBinary( wk->csp, wk->crp, &list );
	}
}

//---------------------------------------------------------------------------------------------
/**
 * セルアクター削除
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatusCellActRerease( PST_WORK * wk )
{
	CATS_ResourceDestructor( wk->csp, wk->crp );
	CATS_FreeMemory( wk->csp );
}

//---------------------------------------------------------------------------------------------
/**
 * セルアクターアニメ
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_CellActAnm( PST_WORK * wk )
{
	CLACT_AnmFrameChg( wk->awp[PST_OBJ_ARROW_L], FX32_ONE );
	CLACT_AnmFrameChg( wk->awp[PST_OBJ_ARROW_R], FX32_ONE );
	CLACT_AnmFrameChg( wk->awp[PST_OBJ_RIBBON_AU], FX32_ONE );
	CLACT_AnmFrameChg( wk->awp[PST_OBJ_RIBBON_AD], FX32_ONE );
}


//---------------------------------------------------------------------------------------------
/**
 * セルアクター追加
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatusCellActSet( PST_WORK * wk )
{
	u16	i;

	for( i=0; i<PST_OBJ_MAX; i++ ){
		wk->awp[i] = CATS_ObjectAdd( wk->csp, wk->crp, &ActAddParam[i] );
	}

	InitObjCharPalChg( wk );

//	CLACT_SetDrawFlag( wk->awp[PST_OBJ_WAZACURSOR1], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_WAZACURSOR2], 0 );

	CLACT_SetDrawFlag( wk->awp[PST_OBJ_UP1], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_UP2], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_UP3], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_UP4], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_UP5], 0 );

	CLACT_SetDrawFlag( wk->awp[PST_OBJ_A_BUTTON], 0 );

	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_STYLE], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_BEAUTIFUL], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_CUTE], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_CLEVER], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_STRONG], 0 );

	CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_FLASH1], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_FLASH2], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_FLASH3], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_FLASH4], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_FLASH5], 0 );

	// パフォーマンス値アイコン隠す
	performance_icon_hide( wk );

	// 葉っぱOBJ表示
	poke_leaf_icon_hide( wk );

	CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_POKERUS], 0 );
}

static u8 PokeCursorPos[][2] =
{	// x, y
	{ 183,  55 }, { 223,  63 },
	{ 183,  87 }, { 223,  95 },
	{ 183, 119 }, { 223, 127 },
};

//---------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンカーソル
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PSTOBJ_PokeCursorPut( PST_WORK * wk )
{
	if( wk->dat->ppt != PST_PP_TYPE_POKEPASO ){
		CATS_ObjectPosSet(
			wk->awp[PST_OBJ_WAZACURSOR1],
			PokeCursorPos[wk->dat->pos][0],
			PokeCursorPos[wk->dat->pos][1] );
		CLACT_AnmChg( wk->awp[PST_OBJ_WAZACURSOR1], 2 );
	}else{
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_WAZACURSOR1], 0 );
	}
}


//---------------------------------------------------------------------------------------------
/**
 * ページタブの表示X座標設定
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	X座標
 */
//---------------------------------------------------------------------------------------------
static u8 PST_TabPosXGet( PST_WORK * wk )
{
	u8	i, num=0;

	//	タブ数チェック
	for( i=0; i<PST_PAGE_MAX; i++ ){
		if( PokeStatus_PageCheck( wk, i ) != 0 ){
			num++;
		}
	}
	return ( TAB_CENTER_PX - ( TAB_SEL_SX + (num-1)*TAB_NOSEL_SX ) / 2 );
}


//---------------------------------------------------------------------------------------------
/**
 * ページタブ切り替え
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatusTabPosChg( PST_WORK * wk )
{
	CLACT_WORK_PTR * awp;
	s16	x, y;
	s16	px;
	u16	anm;
	u8	i;
	u8	num=0;

	awp = &wk->awp[PST_OBJ_TAB_INFO];
	for( i=0; i<PST_PAGE_MAX+4; i++ ){
			CLACT_SetDrawFlag( awp[i], 0 );
	}
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_ARROW_L], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_ARROW_R], 0 );

	return;
#if 0
	px = PST_TabPosXGet( wk );

	awp = &wk->awp[PST_OBJ_TAB_INFO];
	num = 0;
	for( i=0; i<PST_PAGE_MAX; i++ ){
		if( PokeStatus_PageCheck( wk, i ) == 0 ){
			CLACT_SetDrawFlag( awp[i], 0 );
			continue;
		}

		anm = CLACT_AnmGet( awp[i] );
		if( wk->page == i ){
			if( anm < 8 ){
				CLACT_AnmChg( awp[i], anm + 8 );
			}
		}else{
			if( anm >= 8 ){
				CLACT_AnmChg( awp[i], anm-8 );
			}
		}

		CATS_ObjectPosGet( awp[i], &x, &y );
		if( wk->page >= i ){
			x = px + num * TAB_NOSEL_SX;
		}else{
			x = px + TAB_SEL_SX + (num-1)*TAB_NOSEL_SX;
		}
		CATS_ObjectPosSet( wk->awp[i], x, y );
		CLACT_SetDrawFlag( awp[i], 1 );
		num++;
	}
#endif
}

//---------------------------------------------------------------------------------------------
/**
 * 捕獲ボール切り替え
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatusBallAnmChg( PST_WORK * wk )
{
	u32	chr;

	OS_Printf( "ball No = %d\n", wk->pp.ball );

	if( wk->pp.ball == 0 ){
		chr = NARC_pst2_gra_ball00_NCGR;
	}else{
		chr = NARC_pst2_gra_ball00_NCGR + wk->pp.ball - 1;
	}

	CATS_ChangeResourceCharArc( wk->csp, wk->crp, ARC_POKESTATUS_GRA, chr, 0, PST_CHR_ID_BALL );

	CATS_ChangeResourcePlttArc(
		wk->csp, wk->crp, ARC_POKESTATUS_GRA,
		NARC_pst2_gra_ball00_NCLR+BallPalTbl[wk->pp.ball], 0, 6 );
}

//---------------------------------------------------------------------------------------------
/**
 * 状態異常アイコン切り替え
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_StIconChg( PST_WORK * wk )
{
	if( wk->pp.st == ST_ICON_NONE ){
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_STIZYO], 0 );
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_POKERUS], 0 );
	}else if( wk->pp.st != ST_ICON_POKERUS ){
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_POKERUS], 0 );
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_STIZYO], 1 );
		CLACT_AnmChg( wk->awp[PST_OBJ_STIZYO], wk->pp.st );
	}else{
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_CON_POKERUS], 1 );
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_STIZYO], 0 );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモンデータ関連のOBJを設定
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void InitObjCharPalChg( PST_WORK * wk )
{
	u16	i;

	// ポケモンの属性アイコン
	PokeStatus_PokeTypeChange( wk );
	// 技属性
	for( i=0; i<4; i++ ){
		if( wk->pp.waza[i] == 0 ){ continue; }
		PokeStatus_TypeIconChange(
			wk, PST_OBJ_TYPE_WAZA1+i, PST_CHR_ID_WAZATYPE1+i,
			WT_WazaDataParaGet(wk->pp.waza[i],ID_WTD_wazatype) );
	}
	// ポケモンアイコン
	PokeStasus_PokeIconChange( wk );
}


//---------------------------------------------------------------------------------------------
/**
 * タイプアイコン表示
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_PageTypeIconDraw( PST_WORK * wk )
{
	u16	i;

	for( i=PST_OBJ_TYPE_POKE1; i<=PST_OBJ_POKEICON; i++ ){
		CATS_ObjectEnable( wk->awp[i], 0 );
	}

	if( wk->pp.tamago != 0 ){ return; }

	switch( wk->page ){

	// ポケモンじょうほうのタイプアイコン設定
	case PST_PAGE_INFO_MEMO:
		CATS_ObjectEnable( wk->awp[PST_OBJ_TYPE_POKE1], 1 );
		CATS_ObjectPosSet( wk->awp[PST_OBJ_TYPE_POKE1], PT_ICON_P1_PX, PT_ICON_P1_PY );
		if( wk->pp.type1 != wk->pp.type2 ){
			CATS_ObjectEnable( wk->awp[PST_OBJ_TYPE_POKE2], 1 );
			CATS_ObjectPosSet(
				wk->awp[PST_OBJ_TYPE_POKE2], PT_ICON_P1_PX+34, PT_ICON_P1_PY );
		}
		break;

	// わざ情報のわざタイプアイコン設定
	case PST_PAGE_PARAM_B_SKILL:
		for( i=0; i<4; i++ ){
			if( wk->pp.waza[i] == 0 ){ continue; }
			PokeStatus_TypeIconChange(
				wk, PST_OBJ_TYPE_WAZA1+i, PST_CHR_ID_WAZATYPE1+i,
				WT_WazaDataParaGet(wk->pp.waza[i],ID_WTD_wazatype) );
			CATS_ObjectEnable( wk->awp[PST_OBJ_TYPE_WAZA1+i], 1 );
			CATS_ObjectPosSet(
				wk->awp[PST_OBJ_TYPE_WAZA1+i], WT_ICON_P4_PX, WT_ICON_P4_PY+i*32 );
		}
		if( wk->dat->waza != 0 ){
			PokeStatus_TypeIconChange(
				wk, PST_OBJ_TYPE_WAZA1+4, PST_CHR_ID_WAZATYPE1+4,
				WT_WazaDataParaGet(wk->dat->waza,ID_WTD_wazatype) );
			CATS_ObjectEnable( wk->awp[PST_OBJ_TYPE_WAZA1+4], 1 );
			CATS_ObjectPosSet(
				wk->awp[PST_OBJ_TYPE_WAZA1+4], WT_ICON_P4_PX, WT_ICON_P4_PY+4*32+16 );
		}else{
			CATS_ObjectEnable( wk->awp[PST_OBJ_TYPE_WAZA1+4], 0 );
		}
		CATS_ObjectPosSet( wk->awp[PST_OBJ_TYPE_POKE1], PT_ICON_P4_PX, PT_ICON_P4_PY );
		CATS_ObjectPosSet( wk->awp[PST_OBJ_TYPE_POKE2], PT_ICON_P4_PX+34, PT_ICON_P4_PY );
		CATS_ObjectPosSet( wk->awp[PST_OBJ_TYPE_KIND], KT_ICON_P4_PX, KT_ICON_P4_PY );
		break;

	}
}


//------------------------------------------------------------------
/**
 * @brief   パフォーマンス値アイコン隠す
 *
 * @param	wk		ステータス画面ワーク
 *
 * @retval  static
 */
//------------------------------------------------------------------
static void performance_icon_hide( PST_WORK *wk )
{
	int i;

	for(i=0;i<PERFORMANCE_OBJ_NUM;i++){
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_PERFORMANCE_00_00+i], 0);
	}
	for(i=0;i<PERFORMANCE_ARROW_NUM;i++){
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_PERFORMANCE_ARROW_00+i], 0);
	}
}


//------------------------------------------------------------------
/**
 * @brief   葉っぱOBJ隠す１
 *
 * @param	wk		ステータス画面ワーク
 *
 * @retval  none
 */
//------------------------------------------------------------------
static void poke_leaf_icon_hide( PST_WORK *wk )
{
	int i;
	for(i=0;i<6;i++){
		CLACT_SetDrawFlag( wk->awp[PST_OBJ_LEAF_00+i], 0 );
		CLACT_SetAnmFlag( wk->awp[PST_OBJ_LEAF_00+i], 1 );
		CLACT_DrawPriorityChg( wk->awp[PST_OBJ_LEAF_00+i], 6-i );
	}

}

#define AFFECT_DOWN_LINE	( -14 )
#define AFFECT_UP_LINE		(  14 )


//------------------------------------------------------------------
/**
 * @brief   パフォーマンス値自体を表示するかどうか
 *
 * @param   act			アクターのポインタ
 * @param   start		設定開始のインデックス(パフォーマンス値を表す星のOBJインデックス0/5）
 * @param   max			パフォーマンスのMAX値
 * @param   num			パフォーマンスの現在値
 * @param   revision	パフォーマンス値のリビジョンコード PERFORMANCE_DIFF_CODE（PM_PERFORMANCE->revisionの値)
 * @param   affect		現在のコンディション値
 * @param   arrow		矢印OBJのNO
 *
 * @retval  none
 */
//------------------------------------------------------------------
static void DrawPerformanceIcon( CLACT_WORK_PTR *act, int start, int max, int num, int revision, int affect, int arrow )
{
	int i,result;
	u8 stars[5];

	OS_Printf("%d: max=%d, num=%d, affect=%d\n", PST_OBJ_PERFORMANCE_00_00-start, max,num,affect);

	// 星の形状と調子値のフラグを取得
	result = GetPerformanceMeterInfo( stars, max, num, revision, affect );

	// 星の形を適用
	for(i=0;i<5;i++){
		// 表示無し
		if(stars[i]==0){
			CLACT_SetDrawFlag( act[start+i], 0 );
		// 空の星
		}else if(stars[i]==1){
			CLACT_SetDrawFlag( act[start+i], 1 );
			CLACT_AnmChg( act[start+i], 3 );
		// 調子が悪い星
		}else if(stars[i]==2){
			CLACT_SetDrawFlag( act[start+i], 1 );
			CLACT_AnmChg( act[start+i], 0 );
		// 普通の星
		}else if(stars[i]==3){
			CLACT_SetDrawFlag( act[start+i], 1 );
			CLACT_AnmChg( act[start+i], 1 );
		// 調子の良い星
		}else if(stars[i]==4){
			CLACT_SetDrawFlag( act[start+i], 1 );
			CLACT_AnmChg( act[start+i], 2 );
		}
	}

	// 調子の矢印を表示するかどうか
	if(result==0){
		CLACT_SetDrawFlag( act[arrow], 0 );
	}else if(result>0){
		CLACT_SetDrawFlag( act[arrow], 1 );
		CLACT_AnmChg( act[arrow], 4 );
	}else if(result<0){
		CLACT_SetDrawFlag( act[arrow], 1 );
		CLACT_AnmChg( act[arrow], 5 );
	}

	OS_Printf("max=%d, num=%d, 影響値=%d\n", max, num, affect);
}


#define PERFORMANCE_STAR_NORMAL	( 2 )
//==============================================================================
/**
 * @brief
 *
 * @param   stars		表示する☆の状態を格納する配列（ [5]まで確保して渡してください）
 *						0-4の値が入る（0:星無し 1:空の星 2:ノーマル星 3:GOOD星 4:BAD星)
 * @param   max			パフォーマンス値の最大
 * @param   num			パフォーマンス現状の値
 * @param   revision	パフォーマンス値のリビジョンコード PERFORMANCE_DIFF_CODE（PM_PERFORMANCE->revisionの値)
 * @param   affect		現在のコンディション値
 *
 * @retval  int		0:増減無し	1以上: プラス -1以下:マイナス
 */
//==============================================================================
int GetPerformanceMeterInfo( u8 *stars, int max, int num, int revision, int affect )
{
	int i,result = 0;

	//パフォーマンス値は0〜4の値なので、星の表示時はプラス1して使う
//	max += 1;
//	num += 1;
	for(i=0;i<PERFORMANCE_STAR_MAX;i++){
		if(i > max){
			stars[i] = 0;		// 星を出さない
		}else if(i > num){
			stars[i] = 1;		// 空の星
		}else{
			stars[i] = PERFORMANCE_STAR_NORMAL + revision;
		}
	}
	//調子値を -1〜1に丸める
	if(affect > 0){
		return 1;
	}else if(affect < 0){
		return -1;
	}
	return 0;
#if 0
	int i,result=0;
	for(i=0;i<PERFORMANCE_STAR_MAX;i++){
		if(i<max){
			stars[i] = 1;		// 空の星
		}else{
			stars[i] = 0;		// 星を出さない
		}
	}

	// 現在調子値にあわせて星の形が変わる
	if(affect>AFFECT_DOWN_LINE && affect<AFFECT_UP_LINE){
		result = 0;
	}else if(affect>=AFFECT_UP_LINE){
		result = 1;
	}else if(affect<=AFFECT_DOWN_LINE){
		result = -1;
	}


	for(i=0;i<num;i++){
		// 星の中を表示する所まで反映させる
		stars[i] = PERFORMANCE_STAR_NORMAL + result;
	}

	return result;
#endif
}

//==============================================================================
/**
 * @brief   ポケスロンパフォーマンス値アイコン表示
 *
 * @param	wk		ステータス画面ワーク
 *
 * @retval  none
 */
//==============================================================================
void PokePerformance_PageIconDraw( PST_WORK *wk )
{
	int i;
	// リボン画面で且つパフォーマンス画面がＯＮだったら
	if(wk->page==PST_PAGE_RIBBON && wk->dat->pokethlon){
		POKEMON_PASO_PARAM *ppp = (POKEMON_PASO_PARAM*)PokeStatusPokeParamGet( wk );
		PM_CONDITION pc;			// 調子値
		PM_PERFORMANCE_BASE  ppb;	// パフォーマンス値ベース
		PM_PERFORMANCE		 pm;	// パフォーマンス値

		MI_CpuClear8(&pc,sizeof(PM_CONDITION));

		// パフォーマンス基本値取得
		GetPokePerformanceBasePPP( ppp, &ppb );

		// POKEPARTYならぼんジュース影響分を取得する
		if(wk->dat->ppt==PST_PP_TYPE_POKEPARTY){
			PokeParty_GetPokeCondition( (POKEPARTY*)wk->dat->ppd, &pc, wk->dat->pos );
		}
		// パフォーマンス値取得
		GetPokePerformancePPP( &pm, ppp, &pc, HEAPID_POKESTATUS);

		// ☆を表示するか設定
		DrawPerformanceIcon( wk->awp, PST_OBJ_PERFORMANCE_00_00, ppb.speed.max, pm.speed, pm.rev_speed, pc.speed, PST_OBJ_PERFORMANCE_ARROW_00 );
		DrawPerformanceIcon( wk->awp, PST_OBJ_PERFORMANCE_01_00, ppb.power.max, pm.power, pm.rev_power, pc.power, PST_OBJ_PERFORMANCE_ARROW_01 );
		DrawPerformanceIcon( wk->awp, PST_OBJ_PERFORMANCE_02_00, ppb.technique.max, pm.technique, pm.rev_technique, pc.technique, PST_OBJ_PERFORMANCE_ARROW_02 );
		DrawPerformanceIcon( wk->awp, PST_OBJ_PERFORMANCE_03_00, ppb.stamina.max, pm.stamina, pm.rev_stamina, pc.stamina, PST_OBJ_PERFORMANCE_ARROW_03);
		DrawPerformanceIcon( wk->awp, PST_OBJ_PERFORMANCE_04_00, ppb.jump.max, pm.jump, pm.rev_jump, pc.jump, PST_OBJ_PERFORMANCE_ARROW_04 );

	}else{
		// パフォーマンス値アイコン隠す
		performance_icon_hide( wk );
	}
}



//------------------------------------------------------------------
/**
 * @brief   はっぱ表示
 *
 * @param	wk		ステータス画面ワーク
 *
 * @retval  none
 */
//------------------------------------------------------------------
void PokeLeaf_Draw( PST_WORK *wk )
{
	int i;

	if(wk->page==PST_PAGE_INFO_MEMO){
		if(wk->pp.leaf[5]){
			// 王冠表示（はっぱは全て隠す）
			CLACT_SetDrawFlag( wk->awp[PST_OBJ_LEAF_CROWN], 1);
			for(i=0;i<5;i++){
				CLACT_SetDrawFlag( wk->awp[PST_OBJ_LEAF_00+i], 0);
			}
		}else{
			// はっぱ表示
			for(i=0;i<5;i++){
				if(wk->pp.leaf[i]){
					CLACT_SetDrawFlag( wk->awp[PST_OBJ_LEAF_00+i], 1);
				}else{
					CLACT_SetDrawFlag( wk->awp[PST_OBJ_LEAF_00+i], 0);
				}
			}
			CLACT_SetDrawFlag( wk->awp[PST_OBJ_LEAF_CROWN], 0);
		}
	}else{
		// 表示しないページでは全部隠す
		for(i=0;i<6;i++){
			CLACT_SetDrawFlag( wk->awp[PST_OBJ_LEAF_00+i], 0 );
		}
	}
}

//---------------------------------------------------------------------------------------------
/**
 * ポケモンタイプアイコン切り替え
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_PokeTypeChange( PST_WORK * wk )
{
	PokeStatus_TypeIconChange( wk, PST_OBJ_TYPE_POKE1, PST_CHR_ID_POKETYPE1, wk->pp.type1 );
	PokeStatus_TypeIconChange( wk, PST_OBJ_TYPE_POKE2, PST_CHR_ID_POKETYPE2, wk->pp.type2 );
}

//---------------------------------------------------------------------------------------------
/**
 * タイプアイコン切り替え
 *
 * @param	wk			ステータス画面ワーク
 * @param	act_num		セルアクターID
 * @param	res_id		リソースID
 * @param	type		タイプ
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
static void PokeStatus_TypeIconChange( PST_WORK * wk, u8 act_num, u8 res_id, u8 type )
{
	CATS_ChangeResourceCharArc(
		wk->csp, wk->crp, WazaTypeIcon_ArcIDGet(),
		WazaTypeIcon_CgrIDGet(type), WAZATYPEICON_COMP_CHAR, res_id );

	CATS_ObjectPaletteSet( wk->awp[act_num], WazaTypeIcon_PlttOffsetGet(type)+PST_TYPEICON_PAL );
}

//---------------------------------------------------------------------------------------------
/**
 * 指定位置の技タイプアイコンを取得
 *
 * @param	wk		ステータス画面ワーク
 * @param	pos		位置
 * @param	x		X座標
 * @param	y		Y座標
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
static void WazaTypeChgPosGet( PST_WORK * wk, u8 * pos, s16 * x, s16 * y )
{
	s16	i, py;

	py = WT_ICON_P4_PY+*pos*32;

	for( i=0; i<4; i++ ){
		CATS_ObjectPosGet( wk->awp[PST_OBJ_TYPE_WAZA1+i], x, y );
		if( py == *y ){
			*pos = (u8)i;
			break;
		}
	}
}

//---------------------------------------------------------------------------------------------
/**
 * 技タイプアイコン入れ替え
 *
 * @param	wk		ステータス画面ワーク
 * @param	pos1	位置１
 * @param	pos2	位置２
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_WazaTypePosChange( PST_WORK * wk, u8 pos1, u8 pos2 )
{
	s16	x1, y1, x2, y2;

	WazaTypeChgPosGet( wk, &pos1, &x1, &y1 );
	WazaTypeChgPosGet( wk, &pos2, &x2, &y2 );

	CATS_ObjectPosSet( wk->awp[PST_OBJ_TYPE_WAZA1+pos1], x2, y2 );
	CATS_ObjectPosSet( wk->awp[PST_OBJ_TYPE_WAZA1+pos2], x1, y1 );
}

//---------------------------------------------------------------------------------------------
/**
 * 分類アイコン切り替え
 *
 * @param	wk		ステータス画面ワーク
 * @param	waza	技番号
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_KindIconChange( PST_WORK * wk, u32 waza )
{
	u32	kind = WT_WazaDataParaGet( waza, ID_WTD_kind );

	CATS_ChangeResourceCharArc(
		wk->csp, wk->crp, WazaKindIcon_ArcIDGet(),
		WazaKindIcon_CgrIDGet(kind), WAZAKINDICON_COMP_CHAR, PST_CHR_ID_WAZAKIND );

	CATS_ObjectPaletteSet( wk->awp[PST_OBJ_TYPE_KIND], WazaKindIcon_PlttOffsetGet(kind)+PST_TYPEICON_PAL );
}


//--------------------------------------------------------------------------------------------
/**
 * 技カーソル移動
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void PokeStatus_WazaCursorMove( PST_WORK * wk )
{
	switch( wk->cur_pos ){
	case 4:
		if( wk->dat->mode == PST_MODE_WAZAADD ){
			CATS_ObjectPosSet(
				wk->awp[PST_OBJ_WAZACURSOR1], WAZACURSOR_PX, WAZACURSOR_PY + wk->cur_pos*32+16 );
		}else{
			CATS_ObjectPosSet(
				wk->awp[PST_OBJ_WAZACURSOR1], WAZACURSOR_PX, WAZACURSOR_PY + wk->cur_pos*32 );
		}
		CLACT_AnmChg( wk->awp[PST_OBJ_WAZACURSOR1], 0 );
		break;

	case 5:
		if( wk->dat->mode == PST_MODE_WAZAADD ){
			CATS_ObjectPosSet( wk->awp[PST_OBJ_WAZACURSOR1], RET_CURSOR_PX, RET_CURSOR_PY );
			CLACT_AnmChg( wk->awp[PST_OBJ_WAZACURSOR1], 3 );
		}
		break;

	default:
		CATS_ObjectPosSet(
			wk->awp[PST_OBJ_WAZACURSOR1], WAZACURSOR_PX, WAZACURSOR_PY + wk->cur_pos*32 );
		CLACT_AnmChg( wk->awp[PST_OBJ_WAZACURSOR1], 0 );
	}
}

//---------------------------------------------------------------------------------------------
/**
 * 入れ替えカーソル表示
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_SubWazaCursorSet( PST_WORK * wk )
{
	s16	x, y;

	CATS_ObjectPosGet( wk->awp[PST_OBJ_WAZACURSOR1], &x, &y );
	CATS_ObjectPosSet( wk->awp[PST_OBJ_WAZACURSOR2], x, y );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_WAZACURSOR2], 1 );
}

//---------------------------------------------------------------------------------------------
/**
 * 技覚えの最終確認時のカーソル移動
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PSTOBJ_WazaAddSubCursorPut( PST_WORK * wk )
{
	CATS_ObjectPosSet(
		wk->awp[PST_OBJ_WAZACURSOR2], WAZACURSOR_PX, WAZACURSOR_PY + 4*32+16 );
	CLACT_AnmChg( wk->awp[PST_OBJ_WAZACURSOR2], 0 );
}

//---------------------------------------------------------------------------------------------
/**
 * けづやの光OBJ初期化
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_KezuyaInit( PST_WORK * wk )
{
	u32	i;

	wk->flash_seq = 0;
	wk->flash_cnt = 0;
	wk->flash_pos = 0;

	if( wk->pp.fur == 0 ){
		wk->flash_max = 0;
	}else if( wk->pp.fur == PST_KEDUYA_MAX ){
		wk->flash_max = KEDUYA_ANM_MAX;
	}else{
		wk->flash_max = (((KEDUYA_ANM_MAX<<8)/PST_KEDUYA_MAX)*wk->pp.fur)>>8;
	}

	for( i=PST_OBJ_FLASH1; i<=PST_OBJ_FLASH12; i++ ){
		CLACT_SetDrawFlag( wk->awp[i], 0 );
		CLACT_AnmFrameSet( wk->awp[i], 0 );
	}
}


//---------------------------------------------------------------------------------------------
/**
 * マーク切り替え
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_MarkChg( PST_WORK * wk )
{
	u32	i;

	// ボックスマーク
	for( i=0; i<6; i++ ){
		if( wk->pp.mark & (1<<i) ){
			CLACT_AnmChg( wk->awp[PST_OBJ_MARK1+i], 1 );
		}else{
			CLACT_AnmChg( wk->awp[PST_OBJ_MARK1+i], 0 );
		}
	}

	// レアカラー
	if( wk->pp.rare == 1 && wk->pp.tamago == 0 ){
		CATS_ObjectEnable( wk->awp[PST_OBJ_RARE_MARK], 1 );
	}else{
		CATS_ObjectEnable( wk->awp[PST_OBJ_RARE_MARK], 0 );
	}

	// ポケルス
	if( wk->pp.pokerus == 2 ){
		CATS_ObjectEnable( wk->awp[PST_OBJ_POKERUS_MARK], 1 );
	}else{
		CATS_ObjectEnable( wk->awp[PST_OBJ_POKERUS_MARK], 0 );
	}
}

//---------------------------------------------------------------------------------------------
/**
 * コンディションアップ矢印表示
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_CondUpObjPut( PST_WORK * wk )
{
	u8	i;

	for( i=0; i<5; i++ ){
		if( ( wk->sub_seq & (1<<i) ) ){
			CLACT_SetDrawFlag( wk->awp[PST_OBJ_UP1+i], 1 );
		}
	}
}


//============================================================================================
//	ポケモンアイコン
//============================================================================================
#define	POKEICON_TRANS_SIZE	( 0x20 * 4 * 4 )

//---------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンキャラ変更
 *
 * @param	wk		ステータス画面ワーク
 * @param	pp		POKEMON_PARAM or POKEMON_PASO_PARAM
 * @param	objID	OBJ ID
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
static void PokeIconChange( PST_WORK * wk, void * pp, u32 objID )
{
	NNSG2dCharacterData * chr;
	void * buf;
	u32	arc;
	u32	cgx;

	cgx = NNS_G2dGetImageLocation(
			CLACT_ImageProxyGet(wk->awp[objID]), NNS_G2D_VRAM_TYPE_2DSUB );

	if( wk->dat->ppt == PST_PP_TYPE_POKEPASO ){
		arc = PokeIconCgxArcIndexGet( pp );
	}else{
		arc = PokeIconCgxArcIndexGetByPP( pp );
	}
	buf = ArcUtil_CharDataGet( ARC_POKEICON, arc, 0, &chr, HEAPID_POKESTATUS );

	DC_FlushRange( chr->pRawData, POKEICON_TRANS_SIZE );
	GXS_LoadOBJ( chr->pRawData, cgx, POKEICON_TRANS_SIZE );

	sys_FreeMemoryEz( buf );
}

//---------------------------------------------------------------------------------------------
/**
 * ポケモンアイコン表示切り替え
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStasus_PokeIconChange( PST_WORK * wk )
{
	PokeIconChange( wk, PokeStatusPokeParamGet(wk), PST_OBJ_POKEICON );

	CATS_ObjectPaletteSet(
		wk->awp[PST_OBJ_POKEICON],
		PokeIconPalNumGet(wk->pp.mons,wk->pp.form,wk->pp.tamago)+PST_POKEICON_PAL );

	CLACT_SetFlip(
		wk->awp[PST_OBJ_POKEICON],
		(PokeFormNoPersonalParaGet(wk->pp.mons,wk->pp.form,ID_PER_reverse )^1) );
}


//==============================================================================
/**
 * @brief   手持ちポケモンアイコンの画像転送を一括で行う
 *
 * @param	wk		ステータス画面ワーク
 *
 * @retval  none
 */
//==============================================================================
void PokeStatus_TemotiPokeIconTrans( PST_WORK *wk )
{
	int num,i;
	void *pp;

	pp = PokeStatusPokeParamGet( wk );

	switch(wk->dat->ppt){
	case PST_PP_TYPE_POKEPARAM:
		num=1;
		break;
	case PST_PP_TYPE_POKEPASO:	// POKEMON_PASO_PARAM
		num = 0;
		break;
	case PST_PP_TYPE_POKEPARTY:	// POKEMON_PASO_PARAM
		num = wk->dat->max;
		break;
	}

	for(i=0;i<num;i++){
		switch(wk->dat->ppt){
		case PST_PP_TYPE_POKEPARAM:
			pp = PokeStatusPokeParamGet( wk );
			// パレット指定セット
			CATS_ObjectPaletteSet(
				wk->awp[PST_OBJ_POKEICON1+i],
				PokeIconPalNumGetByPP( pp )+PST_POKEICON_PAL
			);
			break;
		case PST_PP_TYPE_POKEPASO:
			// パレット指定セット
			CATS_ObjectPaletteSet(
				wk->awp[PST_OBJ_POKEICON1+i],
				PokeIconPalNumGetByPPP( pp )+PST_POKEICON_PAL
			);
			break;
		case PST_PP_TYPE_POKEPARTY:
			pp = PokeParty_GetMemberPointer( wk->dat->ppd, i );
			// パレット指定セット
			CATS_ObjectPaletteSet(
				wk->awp[PST_OBJ_POKEICON1+i],
				PokeIconPalNumGetByPP( pp )+PST_POKEICON_PAL
			);
			break;
		}

		PokeIconChange( wk, pp, PST_OBJ_POKEICON1+i );
	}

	// 残りのポケモンアイコンは隠す
	for(;i<6;i++){
		CATS_ObjectEnable( wk->awp[PST_OBJ_POKEICON1+i], CATS_ENABLE_FALSE );
	}
}

#define	BOXSEL_POKEICON_PX	( 215 )
#define	BOXSEL_POKEICON_PY	( 80 )

//---------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンを初期位置へ移動（ボックス用）
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PSTOBJ_BoxPokeIconMove( PST_WORK * wk )
{
	if( wk->dat->ppt != PST_PP_TYPE_POKEPASO ){ return; }

	CATS_ObjectPosSet( wk->awp[PST_OBJ_POKEICON1], BOXSEL_POKEICON_PX, BOXSEL_POKEICON_PY );
	CATS_ObjectPosSet( wk->awp[PST_OBJ_POKEICON2], BOXSEL_POKEICON_PX, BOXSEL_POKEICON_PY );
}

//---------------------------------------------------------------------------------------------
/**
 * ポケモンアイコン切り替え（ボックス用）
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PSTOBJ_BoxPokeIconChg( PST_WORK * wk )
{
	POKEMON_PASO_PARAM * ppp;

	if( wk->dat->ppt != PST_PP_TYPE_POKEPASO ){ return; }

	ppp = PokeStatusPokeParamGet( wk );

	if( wk->box_pokeicon == 0 ){
		CATS_ObjectEnable( wk->awp[PST_OBJ_POKEICON1], 1 );
		CATS_ObjectEnable( wk->awp[PST_OBJ_POKEICON2], 0 );
		PokeIconChange( wk, ppp, PST_OBJ_POKEICON1 );
		CATS_ObjectPaletteSet(
			wk->awp[PST_OBJ_POKEICON1], PokeIconPalNumGetByPPP(ppp)+PST_POKEICON_PAL );
	}else{
		CATS_ObjectEnable( wk->awp[PST_OBJ_POKEICON1], 0 );
		CATS_ObjectEnable( wk->awp[PST_OBJ_POKEICON2], 1 );
		PokeIconChange( wk, ppp, PST_OBJ_POKEICON2 );
		CATS_ObjectPaletteSet(
			wk->awp[PST_OBJ_POKEICON2], PokeIconPalNumGetByPPP(ppp)+PST_POKEICON_PAL );
	}

	wk->box_pokeicon ^= 1;
}


//---------------------------------------------------------------------------------------------
/**
 * ポケモンアイコン表示切り替え
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_PokeIconSet( PST_WORK * wk )
{
	if( wk->page == PST_PAGE_PARAM_B_SKILL ){
		CATS_ObjectPosSet( wk->awp[PST_OBJ_POKEICON], POKE_ICON_PX, POKE_ICON_PY );
	}else{
		CATS_ObjectPosSet( wk->awp[PST_OBJ_POKEICON], CON_POKE_ICON_PX, CON_POKE_ICON_PY );
	}
	CATS_ObjectEnable( wk->awp[PST_OBJ_POKEICON], 1 );
}



//============================================================================================
//	簡易コンディション
//============================================================================================
#define	EZCON1_MIN_X	( 88 )
#define	EZCON1_MAX_X	( 88 )
#define	EZCON1_MIN_Y	( 73 )
#define	EZCON1_MAX_Y	( 49 )

#define	EZCON2_MIN_X	( 88 )
#define	EZCON2_MAX_X	( 110 )
#define	EZCON2_MIN_Y	( 73 )
#define	EZCON2_MAX_Y	( 65 )

#define	EZCON3_MIN_X	( 88 )
#define	EZCON3_MAX_X	( 103 )
#define	EZCON3_MIN_Y	( 73 )
#define	EZCON3_MAX_Y	( 92 )

#define	EZCON4_MIN_X	( 87 )
#define	EZCON4_MAX_X	( 72 )
#define	EZCON4_MIN_Y	( 73 )
#define	EZCON4_MAX_Y	( 92 )

#define	EZCON5_MIN_X	( 87 )
#define	EZCON5_MAX_X	( 65 )
#define	EZCON5_MIN_Y	( 73 )
#define	EZCON5_MAX_Y	( 65 )

#define	EZCND_MAX_RPM	( 300 )
#define	EZCND_DEF_RPM	( 44 )		// 300 = 256 + EZCND_DEF_RPM


//---------------------------------------------------------------------------------------------
/**
 * 簡易コンディションの表示座標取得
 *
 * @param	prm		コンディションタイプ
 * @param	max		最大座標
 * @param	min		最小座標
 *
 * @return	表示座標
 */
//---------------------------------------------------------------------------------------------
static s16 PST_EzCndPosGet( u32 prm, s16 max, s16 min )
{
	u32	dot;

	prm += EZCND_DEF_RPM;

	if( min > max ){
		dot = ( ( min - max ) * prm ) << 16;
		dot = ( dot / EZCND_MAX_RPM ) >> 16;
		return min + (s16)dot * -1;
	}

	dot = ( ( max - min ) * prm ) << 16;
	dot = ( dot / EZCND_MAX_RPM ) >> 16;
	return min + (s16)dot;
}


//---------------------------------------------------------------------------------------------
/**
 * 簡易コンディション表示
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_EzConditionPut( PST_WORK * wk )
{
	CATS_ObjectPosSet(
		wk->awp[PST_OBJ_EZC_STYLE],
		PST_EzCndPosGet( wk->pp.style, EZCON1_MAX_X, EZCON1_MIN_X ),
		PST_EzCndPosGet( wk->pp.style, EZCON1_MAX_Y, EZCON1_MIN_Y ) );
	CATS_ObjectPosSet(
		wk->awp[PST_OBJ_EZC_BEAUTIFUL],
		PST_EzCndPosGet( wk->pp.beautiful, EZCON2_MAX_X, EZCON2_MIN_X ),
		PST_EzCndPosGet( wk->pp.beautiful, EZCON2_MAX_Y, EZCON2_MIN_Y ) );
	CATS_ObjectPosSet(
		wk->awp[PST_OBJ_EZC_CUTE],
		PST_EzCndPosGet( wk->pp.cute, EZCON3_MAX_X, EZCON3_MIN_X ),
		PST_EzCndPosGet( wk->pp.cute, EZCON3_MAX_Y, EZCON3_MIN_Y ) );
	CATS_ObjectPosSet(
		wk->awp[PST_OBJ_EZC_CLEVER],
		PST_EzCndPosGet( wk->pp.clever, EZCON4_MAX_X, EZCON4_MIN_X ),
		PST_EzCndPosGet( wk->pp.clever, EZCON4_MAX_Y, EZCON4_MIN_Y ) );
	CATS_ObjectPosSet(
		wk->awp[PST_OBJ_EZC_STRONG],
		PST_EzCndPosGet( wk->pp.strong, EZCON5_MAX_X, EZCON5_MIN_X ),
		PST_EzCndPosGet( wk->pp.strong, EZCON5_MAX_Y, EZCON5_MIN_Y ) );

	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_STYLE], 1 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_BEAUTIFUL], 1 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_CUTE], 1 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_CLEVER], 1 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_STRONG], 1 );
}

//---------------------------------------------------------------------------------------------
/**
 * 簡易コンディション非表示
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_EzConditionOff( PST_WORK * wk )
{
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_STYLE], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_BEAUTIFUL], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_CUTE], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_CLEVER], 0 );
	CLACT_SetDrawFlag( wk->awp[PST_OBJ_EZC_STRONG], 0 );
}



//============================================================================================
//	リボン
//============================================================================================

//---------------------------------------------------------------------------------------------
/**
 * リボングラフィックセット
 *
 * @param	wk		ステータス画面ワーク
 * @param	id		リボンID
 * @param	pos		表示位置
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
static void PST_RibbonGraSet( PST_WORK * wk, u8 id, u8 pos )
{
	CATS_ChangeResourceCharArc(
		wk->csp, wk->crp, ARC_PSTATUS_GRA,
		RIBBON_DataGet(id,RIBBON_PARA_GRAPHIC), 0, PST_CHR_ID_RIBBON01+pos );

	CATS_ObjectPaletteSet(
		wk->awp[PST_OBJ_RIBBON01+pos],
		RIBBON_DataGet(id,RIBBON_PARA_PALNUM)+PST_RIBBON_PAL );
}

//---------------------------------------------------------------------------------------------
/**
 * リボン初期化
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_RibbonInit( PST_WORK * wk )
{
	u16	i;

	for( i=PST_OBJ_RIBBON01; i<=PST_OBJ_RIBBON_FLASH; i++ ){
		CLACT_SetDrawFlag( wk->awp[i], 0 );
	}

	if( wk->page != PST_PAGE_RIBBON ){ return; }

	for( i=0; i<9; i++ ){
		if( i < wk->ribbon_max ){
			CLACT_SetDrawFlag( wk->awp[PST_OBJ_RIBBON01+i], 1 );
			PST_RibbonGraSet( wk, PokeStatus_RibbonPosIDGet(wk,i), i );
		}
	}
	CLACT_AnmChg( wk->awp[PST_OBJ_RIBBON_FLASH], 0 );
}

//---------------------------------------------------------------------------------------------
/**
 * リボン切り替え
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_RibbonChange( PST_WORK * wk )
{
	u16	i;

	for( i=0; i<9; i++ ){
		if( ( wk->ribbon_scr*9+i ) < wk->ribbon_max ){
			CLACT_SetDrawFlag( wk->awp[PST_OBJ_RIBBON01+i], 1 );
			PST_RibbonGraSet( wk, PokeStatus_RibbonPosIDGet(wk,i), i );
		}else{
			CLACT_SetDrawFlag( wk->awp[PST_OBJ_RIBBON01+i], 0 );
		}
	}
}

//---------------------------------------------------------------------------------------------
/**
 * リボンカーソル移動
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_RibbonCursorMove( PST_WORK * wk )
{
	CATS_ObjectPosSet(
		wk->awp[PST_OBJ_RIBBON_CUR],
		RIBON_PX1 + ( wk->ribbon_pos % 3 ) * RIBBON_MX,
		RIBON_PY1 + ( wk->ribbon_pos / 3 ) * RIBBON_MY );
}

//---------------------------------------------------------------------------------------------
/**
 * リボンの光アニメ
 *
 * @param	wk		ステータス画面ワーク
 *
 * @return	none
 */
//---------------------------------------------------------------------------------------------
void PokeStatus_RibbonFlashAnm( PST_WORK * wk )
{
	if( CLACT_GetDrawFlag( wk->awp[PST_OBJ_RIBBON_FLASH] ) == 1 ){
		CLACT_AnmFrameChg( wk->awp[PST_OBJ_RIBBON_FLASH], FX32_ONE );
	}
}